<include file="./Tpl/Home/Header.html"/>
<link href="/Public/Home/code.css" rel="stylesheet" type="text/css"/>
<div class="codeBody">
	<div class="codeSearchMainBody">
		<ul class="mod-sub-nav">
			<li class="mod-sub-list1">获取验证码</li>
			<li class="mod-sub-list2 list2-active">修改密码</li>
			<li class="mod-sub-list3">修改成功 </li>
		</ul>
		
		<div class="Information">
			<span>您的验证码已经发送到您的注册邮箱，请注意查收。</span>
			<br>
			<span>新&nbsp;&nbsp;密&nbsp;&nbsp;码：<input type="password" class="inputName" name="password" id="password"> </span> <span id="passworddes"></span>
			<br>
			<span>确认密码：<input type="password" class="inputName" name="repassword" id="repassword"> </span> <span id="repassworddes"></span>
			<br>
			<span>验&nbsp;&nbsp;证&nbsp;&nbsp;码：<input type="text" class="inputName" name="checkcode" id="checkcode"> <span id="checkcodedes"></span>
			<br>
			<span><input type="button" value="提交" id="subemail" class="codeSearchButton"></span>
		</div>

	</div>
</div>
<include file="./Tpl/Home/Footer.html"/>
<script type="text/javascript" src="/Public/js/formcheck.js"></script>
<script language="javascript">
$(document).ready(function(){
	$('#password').blur(function(){
	    checkpwd($('#password'),$('#passworddes'));
	});
    $('#password').focus(function(){
	    recover($('#password'),$('#passworddes'));
	});
	$('#repassword').blur(function(){
	    checkpwd($('#repassword'),$('#repassworddes'));
	});
    $('#repassword').focus(function(){
	    recover($('#repassword'),$('#repassworddes'));
	});
	$('#checkcode').blur(function(){
	    chkStr($('#checkcode'),$('#checkcodedes'),'请填写验证码！');
	});
    $('#checkcode').focus(function(){
	    recover($('#checkcode'),$('#checkcodedes'));
	});
	
	$('#subemail').click(function(){
		var p = checkpwd($('#password'),$('#passworddes'));
		var rp =  checkpwd($('#repassword'),$('#repassworddes'));
		var c = chkStr($('#checkcode'),$('#checkcodedes'),'请填写验证码！');
        var eq = true;
        if($('#password').val() != $('#repassword').val()){
		    eq = false;
			$('#repassworddes').html('<font color=red>两次输入的密码不同！</font>');
		}

		if(p && rp && c && eq){
			$.post('{$path}/Account/setpwd',{password:$('#password').val(),checkcode:$('#checkcode').val()},function(d){
			    if(d.status==0){
				    location.href="{$path}/Account/getpwd3";
				}else if(d.status==2){
				    $('#checkcodedes').html('<font color=red>'+d.info+'</font>');
				}else{
				    alert(d.info);
				}
			},'json');
		}
	});
});
</script>